<template>
  <div class="GoodsTemplate">
    <el-dialog>
      <div class="ment-div-form">
        <el-form :model="formData">
          <el-row>
            <el-col :span="3">
              <el-button plain @click="getAllList">全部</el-button>
            </el-col>
            <el-col :span="3">
              <el-form-item label="">
                <el-select v-model="formData.address.shengId" @change="getCityListByid">
                  <el-option v-for="(item,index) in address.provinceList" :key="index" :value="index" :label="item.province.name" /></el-select>
              </el-form-item>
            </el-col>
            <el-col :span="3" class="el-col-offset-1">
              <el-form-item>
                <el-select v-model="formData.address.shiId" @change="getCityInfoByid">
                  <el-option v-for="(item,index) in address.cityList" :key="index" :value="index" :label="item.city.name" /> </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="3" class="el-col-offset-3">
              <el-input
                v-model="formData.keyword"
                class="ele-input"
                placeholder="请输入名称搜索"
              />
            </el-col>
            <el-col :span="3" class="el-col-offset-1">
              <el-button type="primary" class="ele-btn-submit" @click="getList">确认</el-button>
            </el-col>
            <el-col :span="3" class="el-col-offset-1">
              <el-button type="primary" class="ele-btn-submit" @click="addDoctor">添加医生</el-button>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <el-table
        ref="elTable"
        v-loading="listLoading"
        :data="list"
        :fit="true"
        element-loading-text="正在查询中。。。"
        @selection-change="selectChange"
      >
        <el-table-column type="selection" fixed="left" width="50" />
        <el-table-column label="医生" prop="userName" />
        <el-table-column label="服务科室" prop="departmentName" />
        <el-table-column label="医院" prop="hospitalName" />
        <el-table-column label="提供服务" prop="onlineCount" />
        <el-table-column label="操作" fixed="right">
          <template slot-scope="scope">
            <el-button type="text" @click="handleCount(scope.row)">服务统计 </el-button>
            <el-button type="text" @click="handleUpdate(scope.row)">编辑 </el-button>
            <el-button
              type="text"
              class="deleteBtn"
              @click="handleDelete(scope.row)"
            >删除
            </el-button>
          </template>
        </el-table-column>
      </el-table>
      <div class="footer">
        <div class="footer-left">
          <el-button plain size="small" @click="allSelection">全选</el-button>
          <el-button plain size="small" @click="delDoctor">删除</el-button>
        </div>
        <pagination v-show="total>0" :total="total" :page.sync="form.page" :limit.sync="form.limit" @pagination="getList" />
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'GoodsTemplate'
}
</script>

<style scoped>

</style>
